const Root = ''

export function prefixUrl(url: string) {
    return Root + url
}

export async function getTaiwuGong() {
    const req = await fetch(prefixUrl('/data-tw-kong.json'))
    const body = await req.json()
    return body.data as { title: string; html: string }[]
}

export async function getTaiwuTech(): Promise<string[]> {
    const req = await fetch(prefixUrl('/data-tw-tech.txt'))
    const body = await req.text()
    return body.split('\n')
}
